package com.krio.spaceship.Main;

import org.cocos2d.layers.CCLayer;
import org.cocos2d.layers.CCScene;
import org.cocos2d.nodes.CCSprite;
import org.cocos2d.types.CGPoint;

public class SplashScreenLayer extends CCLayer{
	
	private int splashScreenShowingTime = 3;
	public SplashScreenLayer()
	{
		super();
		CCSprite splash = CCSprite.sprite("splash.png");
		splash.setAnchorPoint( CGPoint.ccp(0,0));
		splash.setPosition(CGPoint.ccp(0, 0));
		this.addChild(splash);
		this.schedule("showedEnoughTime", splashScreenShowingTime);
	}
	
	public void showedEnoughTime(float dt){
		this.unscheduleAllSelectors();
		GameController.splashScreenShowedEnoughTime();
	}
	
	public CCScene scene() {
		CCScene scene = CCScene.node();
		
		scene.addChild(this);
		
		return scene;
	} 
}
